package com.ydcycloud.sms.util;

import com.alibaba.fastjson.JSON;
import com.ydcycloud.sms.request.SmsSendRequest;
import com.ydcycloud.sms.response.SmsSendResponse;

public class SmsUtil {
	public static final String charset = "utf-8";
	// 用户平台API账号(非登录账号,示例:N1234567)
	public static String account = "N636654_N4793387";
	// 用户平台API密码(非登录密码)
	public static String pswd = "n2IYm9PN081903";

	/**
	 * 
	 * 普通短信功能
	 * 
	 * @Description: TODO
	 * @param @param msg 短信内容
	 * @param @param phone 手机号码
	 * @return void
	 * @throws
	 * @author yzw
	 * @date 2017年5月25日
	 */
	@SuppressWarnings("unused")
	public static void generalSend(String msg, String phone) {
		String smsSingleRequestServerUrl = "http://vsms.253.com/msg/send/json";
		SmsSendRequest smsSingleRequest = new SmsSendRequest(account, pswd,
				msg, phone);
		String requestJson = JSON.toJSONString(smsSingleRequest);
		String response = ChuangLanSmsUtil.sendSmsByPost(
				smsSingleRequestServerUrl, requestJson);
		SmsSendResponse smsSingleResponse = JSON.parseObject(response,
				SmsSendResponse.class);

	}
}
